home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 8 / 008.d81 / lazy math (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  132 lines

  1. 10 rem**lazy math
  2. 20 rem**john l.eubanks
  3. 40 rem**pineville,louisiana 71360
  4. 50 rem**11/10/84
  5. 55 rem**load "lazy",8
  6. 60 rem**calculates area,perimeter and    circumference
  7. 65 rem***
  8. 68 print"[147]":poke53280,11:poke53281,11
  9. 70 print"                lazy math"
  10. 72 print"                    by "
  11. 74 print"              john l eubanks[159]"
  12. 75 fory=1to1500:nexty:print"[147]"
  13. 77 rem***instructions
  14. 80 print"use this time saver when you"
  15. 82 print"need to calculate the area of a"
  16. 84 print"square, a rectangle or a circle"
  17. 88 print"you can also calculate "
  18. 90 print"the perimeter of a square and a"
  19. 92 print"rectangle as well as the"
  20. 94 print"circumference of a circle"
  21. 96 print"lazy math will even remember "
  22. 98 print"the formulas for you and do the work!"
  23. 140 print"press the '*' key for the menu"
  24. 145 get z$:ifz$<>"*"then145
  25. 150 print"[147]"
  26. 153 print"[158]**************menu**************"
  27. 155 rem**menu with branched choices
  28. 158 print"[159]"
  29. 160 print "key # 1 for area of square"
  30. 170 print "key # 2 for area of rectangle"
  31. 180 print "key # 3 for area of circle"
  32. 185 print"[158]########################################"
  33. 190 print "key # 4 for perimeter of square"
  34. 200 print "key # 5 for perimeter of rectangle"
  35. 210 print "key # 6 for circumference of a circle"
  36. 215 print "key # 7 to  exit to loadstar"
  37. 220 print"press the key # of your choice"
  38. 230 print"[159]"
  39. 235 getp$:ifp$=""then235
  40. 237 p=val(p$):ifp<1orp>7then235
  41. 240 on p goto 300,400,500,600,700,800,10000
  42. 290 rem**calculate area of square
  43. 300 print"[147]":print"area = side squared":print
  44. 310 input"enter the length of a side";s
  45. 315 print"what unit of measurement--inches,etc?"
  46. 318 input m$
  47. 320 sa=s*s:sa=(int(100*(sa+.005)))/100
  48. 325 print"[147]"
  49. 330 print"the area of your square with sides "
  50. 340 print"of ";s;m$;" is"
  51. 345 printsa;"square ";m$:print"[159]"
  52. 350 goto 1000
  53. 390 rem**calculate area of rectangle
  54. 400 print"[147]":print"area=base * height"
  55. 405 print
  56. 410 input"enter the height (short side)";h
  57. 420 input"enter the base (long side)";b
  58. 425 print"what unit of measurement--feet,etc?"
  59. 427 input m$
  60. 430 ra=b*h:ra=(int(100*(ra+.005)))/100
  61. 440 print"[147]"
  62. 450 print"the area of your rectangle with a"
  63. 460 print"height of ";h;m$
  64. 462 print"and a base of ";b;m$
  65. 464 print"is ";ra;"square ";m$:print"[159]"
  66. 470 goto1000
  67. 490 rem**calculate area of circle
  68. 500 print"[147]":print"area = pi * radius squared":print
  69. 505 print"remember that radius is 1/2 the diameter of the circle"
  70. 507 print"and diameter is the distance across"
  71. 510 input"enter the radius of your circle";r
  72. 515 print"what unit of measurement--yards,etc?"
  73. 517 input m$
  74. 520 ca=(r^2)*3.1416:ca=(int(100*(ca+.005)))/100
  75. 530 print"[147]"
  76. 540 print"the area of your circle with a"
  77. 550 print"radius of ";r;m$
  78. 552 print"is ";ca;m$:print"[159]"
  79. 560 goto1000
  80. 590 rem**calculate perimeter of square
  81. 600 print"[147]":print"perimeter =length of side * 4":print
  82. 610 input"enter the length of any side";ss
  83. 615 print"what unit of measurement--inches,etc?"
  84. 617 input m$
  85. 620 sp=ss*4:sp=(int(100*(sp+.005)))/100
  86. 625 print"[147]"
  87. 630 print"the perimeter of your square "
  88. 640 print"with sides of";ss;m$
  89. 645 print"[158]is ";sp;m$:print"[159]"
  90. 650 goto1000
  91. 690 rem**calculate the perimeter of a rectangle
  92. 700 print"[147]":print"perimeter of a rectangle is p=base*2 +    height*2"
  93. 710 input"enter the base (long side)";bb
  94. 720 input"enter the height (short side)";hh
  95. 725 print"what unit of measurement--feet,etc.?"
  96. 727 input m$
  97. 730 rp=(hh*2)+(bb*2):rp=(int(100*(rp+.005)))/100
  98. 735 print"[147]"
  99. 740 print"the perimeter of your rectangle with a"
  100. 750 print"height of";hh;m$
  101. 752 print"and a base of ";bb;m$
  102. 755 print"[158]is ";rp;m$:print"[159]"
  103. 760 goto1000
  104. 790 rem**calculate circumference of a circle
  105. 800 print"[147]":print"c=pi*diameter":print
  106. 810 print"diameter is the distance across"
  107. 820 print
  108. 830 input"enter the diameter of your circle";d
  109. 835 print"what unit of measurement--inches,etc?"
  110. 837 input m$
  111. 840 cc=d*3.1416:cc=(int(100*(cc+.005)))/100
  112. 850 print"[147]"
  113. 860 print"the circumference of your circle with"
  114. 870 print"a diameter of";d;m$
  115. 875 print"[158]is ";cc;m$:print"[159]"
  116. 880 goto 1000
  117. 1000 print"when you are ready to return"
  118. 1010 print"to the menu, press the '*' key"
  119. 1020 gett$:ift$<>"*"then1020
  120. 1030 goto150
  121. 10000 print"[147]":print"are you sure that you want to quit?"
  122. 10010 print"if you answer 'y'"
  123. 10020 print"you will exit to loadstar "
  124. 10030 print"[158]answer 'y' or 'n'"
  125. 10040 input q$
  126. 10050 if q$="n"then 150
  127. 10060 if q$="y" then 63000
  128. 10070 goto10000
  129. 63000 rem    connect back to l.s.
  130. 63002 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  131. 63004 poke198,0:poke631,13:poke632,13:poke198,2:end
  132.